package file;

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Pattern;

public class FilterFileDemo implements FilenameFilter {
	private Pattern pattern;
	public static void main(String[] args) {

	}
	public FilterFileDemo(String regex){
		pattern=Pattern.compile(regex);
	}
	@Override
	public boolean accept(File dir, String name) {
		
		return pattern.matcher(name).matches();
	}
}
